From: Florian Müllner Date: Tue, 10 Sep 2019 03:10:01 +0000 (+0200) Subject: environment: Reimplement Date.toLocaleFormat() override X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~453 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ac1f89610734b422aeaa627d7cb1f5825b4116ee;p=gnome-shell.git environment: Reimplement Date.toLocaleFormat() override Now that we no longer go through GTimeVal to convert from Date to GDateTime, there is no more reason for using a C helper function. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/807 --- diff --git a/js/ui/environment.js b/js/ui/environment.js index 4b330e5da..715aca31d 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -292,7 +292,8 @@ function init() { // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=508783 Date.prototype.toLocaleFormat = function(format) { - return Shell.util_format_date(format, this.getTime()); + let dt = GLib.DateTime.new_from_unix_local(this.getTime() / 1000); + return dt ? dt.format(format) : ''; }; let slowdownEnv = GLib.getenv('GNOME_SHELL_SLOWDOWN_FACTOR');